// Copyright (c) 2010 School of Software, Tsinghua University, Beijing (China)
// All rights reserved.
//
// This file is part of Geoxiom (http://code.google.com/p/geoxiom/); you may 
// redistribute it under the terms of the GNU Lesser General Public License.
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// Author(s) : Kan-Le Shi

#ifndef GEOXIOM_UTILITY_OBJECT_ARRAY_HPP
#define GEOXIOM_UTILITY_OBJECT_ARRAY_HPP

#include <vector>

namespace Geoxiom {
namespace Utility {

<template typename T>
class ObjectArray<T> : std::vector<T*> {
	ObjectArray() : std::vector<T*>() { }
	~ObjectArray() {
		std::vector<T*>::iterator 
			i = std::vector<T*>::begin(),
			e = std::vector<T*>::end();
		for (; i != e; i++)
			delete *i;
	}
};

}
}

#endif